#include <dao.h>
#include <btBulletDynamicsCommon.h>

#include "btCollisionShape.h"

static void calculateLocalInertia(DaoContext *ctx, DValue *p[], int N) {
    btCollisionShape	*ptr = (btCollisionShape*) DaoCData_GetData(p[0]->v.cdata);
    float		mass = p[1]->v.f;
    btVector3		*inertia = (btVector3*) DaoCData_GetData(p[2]->v.cdata);

    ptr->calculateLocalInertia(mass, *inertia);
};

static DaoFuncItem meth[] = {
    { calculateLocalInertia, "calculateLocalInertia(self:btCollisionShape, mass:float, inertia:btVector3)" },
    { NULL, NULL }
};

DaoTypeBase btCollisionShapeTyper = {
    "btCollisionShape",
    NULL,
    NULL,               /* constant */
    meth,       	/* methods */
    { NULL },     	/* parent type */
    { NULL },
    NULL,
    NULL                /* free by free() */
};
